package edu.whut.mall.common.exception;

import edu.whut.mall.common.api.ResultCode;

/**
 * @program: d9lab-mall
 * @description: 自定义通用异常类
 * @author: Wayne
 * @create: 2020-04-11 10:43
 **/
public class MallException extends RuntimeException {
    private ResultCode errorCode;

    public MallException(ResultCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public MallException(String message) {
        super(message);
    }

    public MallException(Throwable cause) {
        super(cause);
    }

    public MallException(String message, Throwable cause) {
        super(message, cause);
    }

    public ResultCode getErrorCode() {
        return errorCode;
    }
}
